Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Manipulating Quaternion Transforms

QuickDraw 3D provides routines that you can use to create and manipulate quaternion transforms. A quaternion transform rotates and twists an object according to the mathematical properties of quaternions.

Q3QuaternionTransform_New

You can use the Q3QuaternionTransform_New function to create a new quaternion transform.

TQ3TransformObject Q3QuaternionTransform_New (TQ3Quaternion *quaternion);
quaternion
A quaternion.

DESCRIPTION

The Q3QuaternionTransform_New function returns, as its function result, a reference to a new transform object of type kQ3TransformTypeQuaternion using the data passed in the quaternion parameter. The data you pass in the quaternion parameter is copied into internal QuickDraw 3D data structures. If QuickDraw 3D cannot allocate memory for those structures, Q3QuaternionTransform_New returns the value NULL .

Q3QuaternionTransform_Submit

You can use the Q3QuaternionTransform_Submit function to submit a quaternion transform without creating an object or allocating memory.

TQ3Status Q3QuaternionTransform_Submit (
                     TQ3Quaternion *quaternion,
                     TQ3ViewObject view);
quaternion
A quaternion.
view
A view.

DESCRIPTION

The Q3QuaternionTransform_Submit function pushes the quaternion transform specified by the quaternion parameter on the view transform stack of the view specified by the view parameter. The function returns kQ3Success if the operation succeeds and kQ3Failure otherwise.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3QuaternionTransform_Get

You can use the Q3QuaternionTransform_Get function to query the private data stored in a quaternion transform.

TQ3Status Q3QuaternionTransform_Get (
                     TQ3TransformObject transform,
                     TQ3Quaternion *quaternion);
transform
A transform.
quaternion
A quaternion.

DESCRIPTION

The Q3QuaternionTransform_Get function returns, in the quaternion parameter, information about the quaternion transform specified by the transform parameter. You should use Q3QuaternionTransform_Get only with transforms of type kQ3TransformTypeQuaternion .

Q3QuaternionTransform_Set

You can use the Q3QuaternionTransform_Set function to set new private data for a quaternion transform.

TQ3Status Q3QuaternionTransform_Set (
                     TQ3TransformObject transform,
                     TQ3Quaternion *quaternion);
transform
A transform.
quaternion
A quaternion.

DESCRIPTION

The Q3QuaternionTransform_Set function sets the quaternion transform specified by the transform parameter to the data passed in the quaternion parameter. You should use Q3QuaternionTransform_Set only with transforms of type kQ3TransformTypeQuaternion .


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |